package edu.tsinghua.oxy.leader.job;

import edu.tsinghua.oxy.leader.service.IJobService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.JobExecutionContext;
import org.springframework.scheduling.quartz.QuartzJobBean;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * 处理URL
 *
 * @author sean
 * @date 2021 - 07 - 28 下午5:15
 */
@Slf4j
//@Component
public class SeedJob extends QuartzJobBean {

    @Resource
    IJobService jobService;

    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) {
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        log.info("SeedJob----" + dtf.format(LocalDateTime.now()));
        jobService.seedsJob();
    }

}
